[Php81] Keep nullable param on NewInInitializerRector#7545
Conversation
|
Ready to merge 👍 |
|
Thank you. I'm wondering how this rule could be ever useful. I personally never saw it practice, except nested PHP attributes :) Let's give this another round and collect feedback in real projects. The |
|
@TomasVotruba you can see example on spiral framework that it cause bc break https://github.com/spiral/framework/blob/3d1055a956093bc7a72e531cf55fb5c3e410ab29/rector.php#L96 so skip there, make nullable is the way it has less bc break. |
|
We need exact code structure. |
|
@TomasVotruba see exact example commit that reverted previous apply and skip the new in initializers, because nullable removed |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
@TomasVotruba per our discussion on 153fc78#r168615132
since the rule register back to
php81set, this safe belt keep nullable is needed.this to avoid new issue opened again:
This needs to be nullable, or it will not safe, however, the drawback is property itself become nullable, while it originally not, as it always initialized inside constructor before.
This also ensure no bc break